var operator = "=";

function getCookieValue(keyStr) {
  var value = null;
  var s = document.cookie;
  var arr = s.split("; ");
  for (var i = 0; i < arr.length; i++) {
    var str = arr[i];
    var k = str.split(operator)[0];
    var v = str.split(operator)[1];
    if (k == keyStr) {
      value = v;
      break;
    }
  }
  return value;
}

function setCookieValue(key, value) {
  document.cookie = key + operator + value;
}
